<?php 
	$user_name = ( isset($_REQUEST["hdn_user_name"]) ? $_REQUEST["hdn_user_name"] : '' );
	$page = ( isset($_REQUEST["hdn_type"]) ? $_REQUEST["hdn_type"] : '' );
	$v_title = '';
	if ( $user_name ){
		$account_id = getElementInfo(' ACCOUNT_NAME = "'.$user_name.'"', "ACCOUNT_ID", "TB_ACCOUNT");
		if ( $account_id ){
			$user_id = $account_id ;
			if ( $user_id ){
				$arr_couple_info = getCoupleInfo($user_id);
				if ($arr_couple_info){
					extract($arr_couple_info);
				}
				$v_title_root = $groom_name . ' &hearts; ' . $bride_name . ' | ' . _LB_ROOT_PATH;
			}
			switch ($page) {
				case 'album';
					$v_title = _LB_ALBUM_PAGE .' | '. $v_title_root;
					include 'dsp_header.php';
					include 'qry_album.php';
					include 'dsp_album.php';
					include 'account/account_footer.php';
				break;
				case 'news';
				break;
				case 'diary';
					$v_title = _LB_DIARY_PAGE .' | '. $v_title_root;
					include 'dsp_header.php';
					
					$news_id = (isset($_REQUEST["diary_id"])) ? $_REQUEST["diary_id"] : 0;
					if ($news_id){
						if ( countAll('AND NEWS_ID = '.$news_id ,'TB_NEWS') ){
							include 'qry_diary.php';
							include 'dsp_diary.php';
						}
						else{
							redir (URL.$user_name.'/diary'._LB_REWRITE_URL);
						}
					}
					else{
						include 'qry_all_diary.php';
						include 'dsp_all_diary.php';
					}
					include 'account/account_footer.php';
				break;
				case 'event';
					$v_title = _LB_EVENT_PAGE .' | '. $v_title_root;
					include 'dsp_header.php';
					include 'qry_event.php';
					include 'dsp_event.php';
					include 'account/account_footer.php';
				break;
				case 'map';
					$v_title = _LB_MAP_PAGE .' | '. $v_title_root;
					include 'dsp_header.php';
					include 'qry_map.php';
					include 'dsp_map.php';
					include 'account/account_footer.php';
				break;
				default;
					$v_title = $v_title_root;
					include 'dsp_header.php';
					include 'user_home.php';
					include 'account/account_footer.php';
				break;
			}

		}
		else{
			redir(URL);
		}
	}else{
		redir(URL);
	}
?>